CREATE TABLE [dbo].[TCREND_GAIN]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_REND_GAST] [dbo].[TD_VC_010] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_REND_GAST] [dbo].[TD_DT_001] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TCREND_GA__NU_PR__57A801BA] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCREND_GA__CO_US__589C25F3] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCREND_GA__FE_US__59904A2C] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCREND_GA__CO_US__5A846E65] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCREND_GA__FE_US__5B78929E] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCREND_GAIN] ADD CONSTRAINT [PK__TCREND_G__F2751F7A42C2BEC4] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_REND_GAST], [CO_UNID_CONC], [FE_REND_GAST], [NU_PROC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCREND_GAIN] ADD CONSTRAINT [FK__TCREND_GAIN__169A23C3] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST]) REFERENCES [dbo].[TCREND_GAST] ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST])
GO
